package by.brest.bspc.web;

import java.util.List;

/**
 * Contains a hierarchy of directories with documentations.
 *
 * @date: 9/14/13 10:33 PM
 * @author: frehty
 */
public class TreeNode {
    private String name;
    private List<TreeNode> directories;

    /**
     * Constructor with init parameters.
     *
     * @param name        name of the current node.
     * @param directories list of directories from the current node.
     */
    public TreeNode(String name, List<TreeNode> directories) {
        this.name = name;
        this.directories = directories;
    }

    /**
     * Gets name of the current node.
     *
     * @return name of the current node.
     */
    public String getName() {
        return name;
    }

    /**
     * Sets name of the current node.
     *
     * @param name name of the current node.
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Gets list of directories from the current node.
     *
     * @return list of directories from the current node.
     */
    public List<TreeNode> getDirectories() {
        return directories;
    }

    /**
     * Sets list of directories from the current node.
     *
     * @param directories list of directories from the current node.
     */
    public void setDirectories(List<TreeNode> directories) {
        this.directories = directories;
    }

    @Override
    public String toString() {
        return "TreeNode{" +
                "name='" + name + '\'' +
                ", directories=" + directories +
                '}';
    }

}
